<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name')->default('')->comment('微信昵称');
            $table->string('mobile')->default('')->comment('手机号');
            $table->string('password')->default('')->comment('密码');
            $table->string('wx_openid')->default('')->comment('用户在当前小程序的唯一标识');
            $table->string('wx_unionid')->default('')->comment('微信开放平台帐号下的唯一标识');
            $table->string('wx_session_key')->default('')->comment('本次登录的会话密钥');
            $table->string('avatar')->default('')->comment('微信头像');
            $table->unsignedTinyInteger('gender')->default(0)->comment('用户性别：0女，1男');
            $table->string('country')->default('')->comment('用户所在国家');
            $table->string('province')->default('')->comment('用户所在省份');
            $table->string('city')->default('')->comment('用户所在城市');
            $table->string('language')->default('')->comment('显示 country，province，city 所用的语言');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
